<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .a{
            width: 300px;
            height: 1000px;
            background-color: #9c8383e2;
        }
        .b{
            width: 100px;
            height: 100px;
            background-color: red;
            position: fixed;
        }
    </style>
</head>
<body>
    <div class="a">
        <p>1</p>
        <p>2</p>
        <p>3</p>
        <p>4</p>
        <p>5</p>
        <p>6</p>
        <p>7</p>
        <p>8</p>
        <div class="b"></div>

    </div>
</body>
</html>